import * as types from './ActionTypes.js';
import {createAction} from 'redux-actions';
import {fetchRequest, JsonFetch} from '../util/fetch';

//查看投递的简历
export const Sel_P_sendAction = createAction(types.SEL_P_SEND, (data) => {
    return fetchRequest('Postion/selPostionSendMob.go', 'POST', data);
});

//查询公司状态是否可以发布职位
export const ForPublishAction = createAction(types.FORPUBLISHMOB, (data) => {
    return fetchRequest('Postion/forPublishMob.go', 'GET');
});

//发布职位
export const InsertPostionAction = createAction(types.INSERT_POSTION, (data) => {
    return fetchRequest('Postion/insertPostionMob.go', 'POST', data);
});

//公司职位详情
export const Sel_Pos_ComAction = createAction(types.SEL_POS_COM, (data) => {
    return fetchRequest('Postion/selPosComMob.go', 'POST', data);
});

//修改发布过职位的状态
export const UpdateStatePasueMobAction = createAction(types.UPDATE_STATE_PASUE_MOB, (data) => {
    return fetchRequest('Postion/updateStatePasueMob.go', 'POST', data);
});

//添加修改公司信息
export const Edit_CompanyAction = createAction(types.EDIT_COMPANY_MOB, (data) => {
    return JsonFetch('CompanyInfo/editCompanyMob.go', 'POST', data);
});

// 20171215-王继顺
// 移动端-职位管理-浏览人数
export const SelPosBrowseAction = createAction(types.SEL_POS_BROWSE, (data) => {
    return fetchRequest('Postion/selPosBrowseMob.go', 'POST', data);
});

//20171220-王继顺
//职位-暂不合适
export const PostionSendDelayAction = createAction(types.POSTION_SEND_DELAY, (data) => {
    return fetchRequest('PostionSend/update_bppMob.go', 'POST', data);
});

//20171220-王继顺
//职位-预约面试
export const PostionSendAcceptAction = createAction(
    types.POSTION_SEND_ACCEPT,
    data => fetchRequest('PostionSend/updateAcceptMob.go', 'POST', data)
);

